<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="root"></div>
</body>

</html>
<script src="https://unpkg.com/vue@next"></script>
<script>
    // render function
    // template => render => h => 虚拟DOM(js对象) => 真实DOM => 展示到页面上
    const app = Vue.createApp({
        template: `
        <my-title :level="2">
            hello dell
        </my-title>
        `
    })
    app.component('my-title',{
        props:['level'],
        render(){
            const{h}=Vue;
            return h('h'+this.level,{},[
                this.$slots.default(),
                h('h4',{},"dell")
            ])
        }
    })
    const vm = app.mount('#root')
</script>
